#!/bin/bash

who |grep -v ^root|awk '{print $1,$2}' >file1
while read user tty
do
	echo "$user : hi,i'm root!" >/dev/$tty
done <file1
